#ifndef __SCRIPT_PARSER_H__
#define __SCRIPT_PARSER_H__

#include "Packet.h"

class ScriptParser
{

private:
	static _WORK_RESULT ReadScriptFile(const std::string& script_path , Json::Value& root);


public:

	static _WORK_RESULT MakeFFMpegCmd( _JOB_INFO& job_info , std::vector<_PROCESS_CMD>& vecCmd, std::string& filterId , std::string& effectIdList , std::string& soundId);
	static _WORK_RESULT MakeEachCommand(const std::vector<_OBJ_INFO>& vecValue ,const int exe_count ,const int index , _JOB_INFO& job_info , std::string& cmd , const bool grayscale , const bool nosound);

	static std::string MakeVideoInputCommand(_OBJ_INFO& oi);
	static std::string MakeVideoFormerFilterCommand(_JOB_INFO& ji , _OBJ_INFO& oi , int input_index);
	static std::string MakeVideoLatterFilterCommand(_OBJ_INFO& oi , int input_index, std::string& prev_mark, int accum_len);

	static _WORK_RESULT AddTrailerCmd(_JOB_INFO& job_info , std::vector<_PROCESS_CMD>& vecCmd);
	static int AddThumbnailCmd( _JOB_INFO& job_info, const double thumbnailTime, std::vector<_PROCESS_CMD>& vecCmd);

	static bool DivideFile(const std::string& in_path , const std::vector<std::string>& vecPath, const std::vector<int>& vecSize);
	static bool MakeInputListFile(const std::string& inputlist_path , const std::vector<std::string>& vecPath);

	static _WORK_RESULT CopyFilesFromS3(_JOB_INFO& job_info); 

	static double GetVideoDuration(const std::string& filePath); 
	static double GetAudioDuration(const std::string& filePath); 

	static void MakeM3u8IndexFile( _JOB_INFO& ji);

	static _WORK_RESULT ResaveImageFile(const std::string& path);

};


#endif
